<template>
  <div id="app">
    <van-tabbar route v-if="$route.meta.isFootShow">
      <van-tabbar-item replace to="/home" icon="wap-home-o">首页</van-tabbar-item>
      <van-tabbar-item replace to="/topic" icon="orders-o">专题</van-tabbar-item>
      <van-tabbar-item replace to="/category" icon="cluster-o">分类</van-tabbar-item>
      <van-tabbar-item replace :to="{path: '/cart',query:{openId:17516331686}}" icon="shopping-cart-o">购物车</van-tabbar-item>
      <van-tabbar-item replace to="/my" icon="user-o">我的</van-tabbar-item>
    </van-tabbar>
    <router-view />
  </div>
</template>

<script>
export default {
  created() {
    var userInfo = {
      openId: "17516331686",

      nickName: "张三",

      avatarUrl:
        "https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTIbWFEIJj8IpGeHM7dGic1aTFZALjWcMm9ltWfFiaQfVRYticWBfgGfzXWMt2EkJWiaicPtftHAlWxUibxQ/132"
    };

    var openId = userInfo.openId;

    localStorage.setItem("userInfo", JSON.stringify(userInfo));

    localStorage.setItem("openId", openId);
  }
};
</script>

<style lang="scss">
body{
  height: 100%;
  font-size: 12px;
  background-color: #faf6f6;
  margin-bottom: 1.333333rem;
}

#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
</style>
